<template>
  <div>
      {{form.name}} <br>
      {{form.pass}} <br>
      {{name}} <br>
      <van-button @click="getvalues()" type="primary">主要按钮</van-button>
  </div>
</template>

<script>
import { onMounted,reactive,ref } from 'vue'
import axios from '../http/axios'
export default {
    setup(){
        let form = reactive({'name':'aaa','pass':'111'})
        let name = ref('啊啊啊')
        let getvalues=()=>{
            form.name = 'bbb'
            form.pass = '222'
            name.value = '变变变'
        }
        const ceshi=()=>{
            axios('say_hello','get').then(res=>{
                console.log(res);
            })
        }
        // 钩子方法 调用方法 执行
        onMounted(()=>{
            getvalues()
            ceshi()
        })
        return{
            form,
            name,
            getvalues,
            ceshi
        }
    }
}
</script>

<style>

</style>